<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs For Class Swift_Plugin_Decorator</title>
			<link rel="stylesheet" href="../../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			
<h2 class="class-name">Class Swift_Plugin_Decorator</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
													<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
						|											<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
					</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Swift Decorator Plugin.</p>
<p class="description"><p>Allows messages to be slightly different for each recipient.</p></p>
	<ul class="tags">
				<li><span class="field">author:</span> Chris Corbyn &lt;<a href="mailto:chris@w3style.co.uk">chris@w3style.co.uk</a>&gt;</li>
			</ul>
		<p class="notes">
			Located in <a class="field" href="_Swift---Plugin---Decorator.php.html">/Swift/Plugin/Decorator.php</a> (line <span class="field">22</span>)
		</p>
		
				
		<pre><a href="../../Swift_Events/Swift_Events_Listener.html">Swift_Events_Listener</a>
   |
   --Swift_Plugin_Decorator</pre>
	
			</div>
</div>



	<a name="sec-var-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Variable Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
						<span class="disabled">Vars</span> (<a href="#sec-vars">details</a>)
							| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
								</div>
		<div class="info-box-body">
			<div class="var-summary">
																																																<div class="var-title">
					<span class="var-type">boolean</span>
					<a href="#$permittedInHeaders" title="details" class="var-name">$permittedInHeaders</a>
				</div>
																<div class="var-title">
					<span class="var-type">array</span>
					<a href="#$permittedTypes" title="details" class="var-name">$permittedTypes</a>
				</div>
																<div class="var-title">
					<span class="var-type"><a href="../../Swift_Plugin/Decorator/Swift_Plugin_Decorator_Replacements.html">Swift_Plugin_Decorator_Replacements</a></span>
					<a href="#$replacements" title="details" class="var-name">$replacements</a>
				</div>
																<div class="var-title">
					<span class="var-type">array</span>
					<a href="#$store" title="details" class="var-name">$store</a>
				</div>
											</div>
		</div>
	</div>

	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
																		<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
				 
				|
						<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
																																																																																																												
												<div class="method-definition">
											<span class="method-result">Swift_Plugin_Decorator</span>
										<a href="#Swift_Plugin_Decorator" title="details" class="method-name">Swift_Plugin_Decorator</a>
											([<span class="var-type">mixed</span>&nbsp;<span class="var-name">$replacements</span> = <span class="var-default">null</span>])
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#addPermittedType" title="details" class="method-name">addPermittedType</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$type</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#beforeSendPerformed" title="details" class="method-name">beforeSendPerformed</a>
											(<span class="var-type"><a href="../../Swift_Events/Swift_Events_SendEvent.html">Swift_Events_SendEvent</a></span>&nbsp;<span class="var-name">&$e</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">boolean</span>
										<a href="#getPermittedInHeaders" title="details" class="method-name">getPermittedInHeaders</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">array</span>
										<a href="#getPermittedTypes" title="details" class="method-name">getPermittedTypes</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result"><a href="../../Swift_Plugin/Decorator/Swift_Plugin_Decorator_Replacements.html">Swift_Plugin_Decorator_Replacements</a></span>
										<a href="#getReplacements" title="details" class="method-name">&amp;getReplacements</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">boolean</span>
										<a href="#isPermittedType" title="details" class="method-name">isPermittedType</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$type</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#recursiveReplace" title="details" class="method-name">recursiveReplace</a>
											(<span class="var-type"><a href="../../Swift_Message/Swift_Message_Mime.html">Swift_Message_Mime</a></span>&nbsp;<span class="var-name">&$mime</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">$replacements</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">&$store</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#recursiveRestore" title="details" class="method-name">recursiveRestore</a>
											(<span class="var-type"><a href="../../Swift_Message/Swift_Message_Mime.html">Swift_Message_Mime</a></span>&nbsp;<span class="var-name">&$mime</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">&$store</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#removePermittedType" title="details" class="method-name">removePermittedType</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$type</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">string</span>
										<a href="#replace" title="details" class="method-name">replace</a>
											(<span class="var-type">array</span>&nbsp;<span class="var-name">$replacements</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#setPermittedInHeaders" title="details" class="method-name">setPermittedInHeaders</a>
											(<span class="var-type">boolean</span>&nbsp;<span class="var-name">$bool</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#setReplacements" title="details" class="method-name">setReplacements</a>
											(<span class="var-type">mixed</span>&nbsp;<span class="var-name">&$replacements</span>)
									</div>
								</div>
		</div>
	</div>		

	<a name="sec-vars"></a>
	<div class="info-box">
		<div class="info-box-title">Variables</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
										<a href="#sec-var-summary">Vars</a> (<span class="disabled">details</span>)
						
			
										| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
					</div>
		<div class="info-box-body">
			<a name="var$permittedInHeaders" id="$permittedInHeaders"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">boolean</span>
			<span class="var-name">$permittedInHeaders</span>
			 = <span class="var-default"> true</span>			(line <span class="line-number">43</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">True if values in the headers can be replaced</p>
	
	
		
		

</div>
<a name="var$permittedTypes" id="$permittedTypes"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">array</span>
			<span class="var-name">$permittedTypes</span>
			 = <span class="var-default">array(&quot;text/plain&quot; =&gt; 1, &quot;text/html&quot; =&gt; 1)</span>			(line <span class="line-number">38</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">A list of allowed mime types to replace bodies for.</p>
	
	
		
		

</div>
<a name="var$replacements" id="$replacements"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type"><a href="../../Swift_Plugin/Decorator/Swift_Plugin_Decorator_Replacements.html">Swift_Plugin_Decorator_Replacements</a></span>
			<span class="var-name">$replacements</span>
						(line <span class="line-number">28</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">The replacements object.</p>
	
	
		
		

</div>
<a name="var$store" id="$store"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">array</span>
			<span class="var-name">$store</span>
						(line <span class="line-number">33</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Temporary storage so we can restore changes we make.</p>
	
	
		
		

</div>
						
		</div>
	</div>
	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
															<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
																	<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>

<a name="methodSwift_Plugin_Decorator" id="Swift_Plugin_Decorator"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">Constructor Swift_Plugin_Decorator</span> (line <span class="line-number">49</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Ctor.</p>
	
	<div class="method-signature">
		<span class="method-result">Swift_Plugin_Decorator</span>
		<span class="method-name">
			Swift_Plugin_Decorator
		</span>
					([<span class="var-type">mixed</span>&nbsp;<span class="var-name">$replacements</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">mixed</span>
				<span class="var-name">$replacements</span><span class="var-description">: Replacements as a 2-d array or Swift_Plugin_Decorator_Replacements instance.</span>			</li>
				</ul>
		
			
	</div>
<a name="methodaddPermittedType" id="addPermittedType"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">addPermittedType</span> (line <span class="line-number">73</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Add a mime type to the list of permitted type to replace values in the body.</p>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			addPermittedType
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$type</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$type</span><span class="var-description">: The mime type (e.g. text/plain)</span>			</li>
				</ul>
		
			
	</div>
<a name="methodbeforeSendPerformed" id="beforeSendPerformed"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">beforeSendPerformed</span> (line <span class="line-number">108</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Called just before Swift sends a message.</p>
<p class="description"><p>We perform operations on the message here.</p></p>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			beforeSendPerformed
		</span>
					(<span class="var-type"><a href="../../Swift_Events/Swift_Events_SendEvent.html">Swift_Events_SendEvent</a></span>&nbsp;<span class="var-name">&$e</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type"><a href="../../Swift_Events/Swift_Events_SendEvent.html">Swift_Events_SendEvent</a></span>
				<span class="var-name">&$e</span><span class="var-description">: The event object for sending a message</span>			</li>
				</ul>
		
			
	</div>
<a name="methodgetPermittedInHeaders" id="getPermittedInHeaders"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">getPermittedInHeaders</span> (line <span class="line-number">65</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Check if replacements in headers are allowed.</p>
	
	<div class="method-signature">
		<span class="method-result">boolean</span>
		<span class="method-name">
			getPermittedInHeaders
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodgetPermittedTypes" id="getPermittedTypes"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">getPermittedTypes</span> (line <span class="line-number">90</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Get the list of mime types for which the body can be changed.</p>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			getPermittedTypes
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodgetReplacements" id="getReplacements"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">getReplacements</span> (line <span class="line-number">254</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Get the replacements object.</p>
	
	<div class="method-signature">
		<span class="method-result"><a href="../../Swift_Plugin/Decorator/Swift_Plugin_Decorator_Replacements.html">Swift_Plugin_Decorator_Replacements</a></span>
		<span class="method-name">
			&amp;getReplacements
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodisPermittedType" id="isPermittedType"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">isPermittedType</span> (line <span class="line-number">99</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Check if the body can be replaced in the given mime type.</p>
	
	<div class="method-signature">
		<span class="method-result">boolean</span>
		<span class="method-name">
			isPermittedType
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$type</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$type</span><span class="var-description">: The mime type</span>			</li>
				</ul>
		
			
	</div>
<a name="methodrecursiveReplace" id="recursiveReplace"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">recursiveReplace</span> (line <span class="line-number">133</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Replace strings in the message searching through all the allowed sub-parts.</p>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			recursiveReplace
		</span>
					(<span class="var-type"><a href="../../Swift_Message/Swift_Message_Mime.html">Swift_Message_Mime</a></span>&nbsp;<span class="var-name">&$mime</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">$replacements</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">&$store</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type"><a href="../../Swift_Message/Swift_Message_Mime.html">Swift_Message_Mime</a></span>
				<span class="var-name">&$mime</span><span class="var-description">: The message (or part)</span>			</li>
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$replacements</span><span class="var-description">: The list of replacements</span>			</li>
					<li>
				<span class="var-type">array</span>
				<span class="var-name">&$store</span><span class="var-description">: The array to cache original values into where needed</span>			</li>
				</ul>
		
			
	</div>
<a name="methodrecursiveRestore" id="recursiveRestore"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">recursiveRestore</span> (line <span class="line-number">197</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Put the original values back in the message after it was modified before sending.</p>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			recursiveRestore
		</span>
					(<span class="var-type"><a href="../../Swift_Message/Swift_Message_Mime.html">Swift_Message_Mime</a></span>&nbsp;<span class="var-name">&$mime</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">&$store</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type"><a href="../../Swift_Message/Swift_Message_Mime.html">Swift_Message_Mime</a></span>
				<span class="var-name">&$mime</span><span class="var-description">: The message (or part)</span>			</li>
					<li>
				<span class="var-type">array</span>
				<span class="var-name">&$store</span><span class="var-description">: The location of the stored values</span>			</li>
				</ul>
		
			
	</div>
<a name="methodremovePermittedType" id="removePermittedType"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">removePermittedType</span> (line <span class="line-number">82</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Remove the ability to replace values in the body of the given mime type</p>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			removePermittedType
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$type</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$type</span><span class="var-description">: The mime type</span>			</li>
				</ul>
		
			
	</div>
<a name="methodreplace" id="replace"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">replace</span> (line <span class="line-number">188</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Perform a str_replace() over the given value.</p>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			replace
		</span>
					(<span class="var-type">array</span>&nbsp;<span class="var-name">$replacements</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$replacements</span><span class="var-description">: The list of replacements as (search =&gt; replacement)</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$value</span><span class="var-description">: The string to replace</span>			</li>
				</ul>
		
			
	</div>
<a name="methodsetPermittedInHeaders" id="setPermittedInHeaders"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">setPermittedInHeaders</span> (line <span class="line-number">57</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Enable of disable the ability to replace values in the headers</p>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			setPermittedInHeaders
		</span>
					(<span class="var-type">boolean</span>&nbsp;<span class="var-name">$bool</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">boolean</span>
				<span class="var-name">$bool</span>			</li>
				</ul>
		
			
	</div>
<a name="methodsetReplacements" id="setReplacements"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">setReplacements</span> (line <span class="line-number">229</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Set the replacements as a 2-d array or an instance of Swift_Plugin_Decorator_Replacements.</p>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			setReplacements
		</span>
					(<span class="var-type">mixed</span>&nbsp;<span class="var-name">&$replacements</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">mixed</span>
				<span class="var-name">&$replacements</span><span class="var-description">: Array or Swift_Plugin_Decorator_Replacements</span>			</li>
				</ul>
		
			
	</div>
							<h4>Inherited Methods</h4>
				<a name='inherited_methods'><!-- --></a>	
									<!-- =========== Summary =========== -->
					<p>Inherited From <span class="classname"><a href="../../Swift_Events/Swift_Events_Listener.html">Swift_Events_Listener</a></span></p>
					<blockquote>
													<span class="method-name"><a href="../../Swift_Events/Swift_Events_Listener.html#methodimplementing">Swift_Events_Listener::implementing()</a></span><br>
											</blockquote>
										
		</div>
	</div>


	<p class="notes" id="credit">
		Documentation generated on Wed, 26 Mar 2008 20:33:45 +1100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.3.1</a>
	</p>
	</div></body>
</html>